package pojo;

import java.util.ArrayList;
import java.util.Objects;

/**
 * @author Administrator
 */
public class Group {
    private String groupAccount;
    private String groupName;
    private String hostAccount;
    private ArrayList<User> members;
    private String image;

    public Group(String groupAccount, String groupName, String hostAccount, ArrayList<User> members, String image) {
        this.groupAccount = groupAccount;
        this.groupName = groupName;
        this.hostAccount = hostAccount;
        this.members = members;
        this.image = image;
    }

    public Group() {
    }

    public String getGroupAccount() {
        return groupAccount;
    }

    public String getGroupName() {
        return groupName;
    }

    public String getHostAccount() {
        return hostAccount;
    }

    public ArrayList<User> getMembers() {
        return members;
    }


    public String getImage() {
        return image;
    }

    public void setGroupAccount(String groupAccount) {
        this.groupAccount = groupAccount;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public void setHostAccount(String hostAccount) {
        this.hostAccount = hostAccount;
    }

    public void setMembers(ArrayList<User> memberAccount) {
        this.members = memberAccount;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Group group = (Group) o;
        return groupAccount.equals(group.groupAccount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(groupAccount);
    }

    @Override
    public String toString() {
        return "Group{" +
                "groupAccount='" + groupAccount + '\'' +
                ", groupName='" + groupName + '\'' +
                ", hostAccount='" + hostAccount + '\'' +
                ", members=" + members +
                '}';
    }
}
